﻿using System.Windows;

namespace WPF_Minesweeper
{
    /// <summary>
    /// OverWindows.xaml 的交互逻辑
    /// </summary>
    public partial class OverWindows : Window
    {
        public OverWindows()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 退出按钮点击事件
        /// </summary>
        private void OverExitBtn_Click(object sender, RoutedEventArgs e)
        {
            Application.Current.Shutdown();
        }

        /// <summary>
        /// 再玩一局按钮点击事件
        /// </summary>
        private void OverRestartBtn_Click(object sender, RoutedEventArgs e)
        {
            // 获取主窗体
            MainWindow main;
            main = (MainWindow)Owner;
            // 重新开始游戏
            main.ResetGame();
            // 关闭当前窗体
            Close();
        }
    }
}
